<!-- eslint-disable vue/multi-word-component-names -->
<template>
  <div>
    <van-nav-bar
    title="收货信息"
    left-text="返回"
    left-arrow
    @click-left="$router.go(-1)"
    />
    <van-address-edit
    :area-list="areaList"
    show-delete
    show-search-result
    @save="onSave"
    @delete="onDelete"
    />
  </div>
</template>

<script>
import { areaList } from '@vant/area-data'
export default {
  data () {
    return {
      areaList
    }
  },

  // 接收父组件传递过来的参数
  props: {},

  components: {},

  // computed是计算属性，也就是依赖其它的属性计算所得出最后的值
  computed: {},

  // 页面初始化方法
  mounted () {},

  // 监听方法 click事件等 ，执行drawFeatures方法
  methods: {
    onDelete () {

    },
    onSave (v) {
      const addr = {
        user: v.name,
        uid: JSON.parse(sessionStorage.getItem('userinfo')).uid,
        tel: v.tel,
        address: v.province + '/' + v.city + '/' + v.county
      }
      localStorage.setItem('addr', JSON.stringify(addr))
      this.$router.push('/tab/my')
    }
  }
}

</script>
<style lang='less' scoped>
/deep/.van-nav-bar .van-icon{
    color: #a7cd6d;
}
/deep/.van-nav-bar__text{
    color: #a7cd6d;
}
</style>
